(C) 1996 AROS - The Amiga Replacement OS


NAME
#include <exec/tasks.h>
#include <proto/exec.h>
void StackSwap()
SYNOPSIS
struct StackSwapStruct * sss

LOCATION
In SysBase at offset 122
FUNCTION
Changes the stack used by a task. The StackSwapStruct will contain the value of the old stack such that the stack can be reset to the previous version by another call to StackSwap().

When the stack is swapped, the data on the stack(s) will not be altered, so the stack may not be set up for you. It is generally required that you replace your stack before exiting from the current stack frame (procedure, function call etc.).

INPUTS
sss
A structure containing the values for the upper, lower and current bounds of the stack you wish to use. The values will be replaced by the current values and you can restore the values later.
RESULT
The program will be running on a new stack and sss will contain the old stack.

Calling StackSwap() twice consequtively will effectively do nothing.

NOTES
Returning from the function that you call StackSwap() in can have unexpected results.

EXAMPLE
BUGS
SEE ALSO
AddTask(), RemTask()
INTERNALS
This function MUST be replaced in $(KERNEL) or $(ARCH).

HISTORY
05.08.1997 iaint
Kernel Changes - These are mostly functions which are normally implemented by the kernel, but might not be.